package stdying.handyweibo;

import android.app.Application;
import android.util.Log;

import stdying.handyweibo.injection.component.ApplicationComponent;
import stdying.handyweibo.injection.component.DaggerApplicationComponent;
import stdying.handyweibo.injection.module.ApplicationModule;
import timber.log.Timber;


/**
 * Description: AndroidApplication
 * Author: liulili
 * Created: 2015-11-23
 */
public class AndroidApplication extends Application{
    private ApplicationComponent mApplicationComponent;

    @Override
    public void onCreate() {
        super.onCreate();

        //配置日志
        if (BuildConfig.DEBUG) {
            Log.d("log","log 设置");
            Timber.plant(new Timber.DebugTree());
        }

        mApplicationComponent = DaggerApplicationComponent.builder()
                .applicationModule(new ApplicationModule(this))
                .build();
    }

    public ApplicationComponent getApplicationComponent(){
        return mApplicationComponent;
    }
}
